package com.cgx.controller;

import com.cgx.annotation.ResultHandler;
import com.cgx.entity.User.FriendRelation;
import com.cgx.service.FriendService;
import com.cgx.vo.RequestObject;
import com.cgx.vo.base.BaseIdListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @author chenguanxin
 * @date 2021-07-01 21:21
 */
@Controller
@CrossOrigin("*")
@RequestMapping("/friend")
public class FriendController {
    @Autowired
    private FriendService friendService;

    @ResponseBody
    @RequestMapping("/queryFriend")
    public List<FriendRelation> queryFriend(@RequestBody List<String> idList) {
        return friendService.queryFriend(idList);
    }

    @ResponseBody
    @RequestMapping("/queryFriendBySessionId")
    public List<FriendRelation> queryFriendBySessionId(@RequestBody List<String> idList) {
        return friendService.queryFriendBySessionId(idList);
    }
}
